import { HuifuDetialPage } from './../about/huifu-detial/huifu-detial';
import { PublishChallengeHtGuanfangPage } from './../publish-challenge-ht-guanfang/publish-challenge-ht-guanfang';
import { UrlService } from './../../providers/url-service';
import { Component } from '@angular/core';
import {  NavController, NavParams } from 'ionic-angular';

/**
 * 活动详情
 */
@Component({
  selector: 'page-huodongxiangqing',
  templateUrl: 'huodongxiangqing.html',
})
/**
 * 官方活动详情
 */
export class HuodongxiangqingPage {
  params;
  constructor(
    public navCtrl: NavController,
    public urlServe: UrlService,
    public navParams: NavParams
  ) {
    this.params = this.navParams.get("params");
    this.GetBaseDetails();
  }
  pageData = {
    plist: []
  }
  ionViewDidLoad() {
    console.log('活动详情 HuodongxiangqingPage');


  }
  ionViewDidEnter() {
    this.getPingLunList();
  }
  /**
   * 获取评论列表
   */
  getPingLunList() {
    this.urlServe.GetEvaluateList(this.params.ID, 1)
      .then(msg => {
        this.pageData.plist = msg.Data.Items;
      })
  }

  bacimg;
  GetBaseDetails() {
    this.urlServe.GetBaseDetails(this.params.ID)
      .then(data => {
        if (data.Code == 0) {
          this.bacimg = data.Data.PicUrl;
          console.log(this.bacimg);
        }
      })
      .catch()
  }


  dashang() {
    console.log("打赏");
  }
  /**
   * 打开回复详情
   * @param item 
   */
  openhuiDetial(item) {
    this.navCtrl.push(HuifuDetialPage, { "params": item });
  }
  /**
   * 打开评论
   */
  openPubGF() {
    this.navCtrl.push(PublishChallengeHtGuanfangPage, { "params": this.params });
  }

  jvbao_lht() {
    
  }
}
